package circular;

class Circle{
    private float radius;

    public void setRadius(float r){
        if(r>0){
            radius = r;
        }
        else
            System.out.println("输入错误");
    }

    public float getRadius(){
        return radius;
    }

    public double getArea(){
        return Math.PI*radius*radius;
    }

}

class Circular {
        Circle bottom;
        float height;

        Circular(Circle c1,float h1) {
            bottom = c1;
            height = h1;
        }

        double getVolme(){
            return bottom.getArea()*height/3.0;
        }

        double getBottomRadius(){
            return bottom.getRadius();
        }

}

public class Text{
    public static void main(String[] args){
        Circle circle1 = new Circle();
        circle1.setRadius(3);

        Circular circular1 = new Circular(circle1,6);
        System.out.println("圆锥体的体积:"+circular1.getVolme());
        System.out.println("圆锥体底面积为:"+circular1.bottom.getArea());
    }
}
